Ccay.Module.define("Ccay.demo.pageswitch.SwitchView",function(page,$S){
	//igrid初始化
	page.init = function(value,status){
		if(status){
			$S("#pageSwitchDemo").hide();
		}
		if(value){
			Ccay.UI.topBox("得到值："+value);
		}
	}
	page.ready = function(){
		var gridOptions={
			height:300,
			columns:[
				{//checkbox
					columnType:"select",
					freezeable:true,
					multi:true,
					cssName:"center"
				},
				{//角色名
					field:"roleName",
					width:150,
					header:"ccay.security.label.roleName",
					valueField:'roleName'
				},
				{//说明
					field:"roleDesc",
					width:150,
					header:"ccay.common.label.description"
				},
				{//有效性
					field:"status",
					width:90,
					cssName:"center",
					type:"bool",
					header:"ccay.security.role.valid"
				},
				{//最后更新时间
					field:"lastUpdateDate",
					width:140,
					cssName:"center",
					type:"datetime",
					header:"ccay.common.label.lastUpdatedDate"
				}
		    ]
		}
		$S("#pageGrid").igrid(gridOptions,getData());
	}
	//静态数据源
	getData = function(){
		var datas = [
			{
				"status" : 1,
				"roleName" : "角色1",
				"roleDesc" : null,
				"lastUpdateDate" : "2014-03-21T14:46:28.000+0800"
			}, {
				"status" : 1,
				"roleName" : "角色2",
				"roleDesc" : "暗示飞",
				"lastUpdateDate" : "2014-03-19T11:41:48.000+0800"
			}, {
				"status" : 0,
				"roleName" : "角色3",
				"roleDesc" : "测试所用",
				"lastUpdateDate" : "2014-03-19T11:41:48.000+0800"
			}, {
				"status" : 1,
				"roleName" : "角色4",
				"roleDesc" : null,
				"lastUpdateDate" : "2014-03-19T11:41:48.000+0800"
			}, {
				"status" : 1,
				"roleName" : "角色5",
				"roleDesc" : "System Admin",
				"lastUpdateDate" : "2014-03-18T09:54:15.000+0800"
			}, {
				"status" : 0,
				"roleName" : "角色6",
				"roleDesc" : "test1",
				"lastUpdateDate" : "2014-03-18T09:54:15.000+0800"
			}, {
				"status" : 1,
				"roleName" : "角色7",
				"roleDesc" : "test2",
				"lastUpdateDate" : "2014-03-18T09:54:15.000+0800"
			}, {
				"status" : 1,
				"roleName" : "角色8",
				"roleDesc" : "test3",
				"lastUpdateDate" : "2014-03-18T09:54:15.000+0800"
			}, {
				"status" : 0,
				"roleName" : "角色9",
				"roleDesc" : "sadjflasjfdjsajfdkstest4lsadjflas",
				"lastUpdateDate" : "2014-03-18T09:54:15.000+0800"
			}, {
				"status" : 1,
				"roleName" : "角色10",
				"roleDesc" : null,
				"lastUpdateDate" : "2014-03-18T09:54:15.000+0800"
			}, {
				"status" : 1,
				"roleName" : "角色11",
				"roleDesc" : "System",
				"lastUpdateDate" : "2014-03-18T09:54:15.000+0800"
			}, {
				"status" : 0,
				"roleName" : "角色12",
				"roleDesc" : null,
				"lastUpdateDate" : "2014-03-18T09:54:15.000+0800"
			}, {
				"status" : 1,
				"roleName" : "角色13",
				"roleDesc" : "sdd",
				"lastUpdateDate" : "2014-03-18T09:54:15.000+0800"
			}, {
				"status" : 1,
				"roleName" : "角色14",
				"roleDesc" : null,
				"lastUpdateDate" : "2014-03-18T09:54:15.000+0800"
			}, {
				"status" : 0,
				"roleName" : "角色15",
				"roleDesc" : "",
				"lastUpdateDate" : "2014-03-18T09:54:15.000+0800"
			}
		];
		return datas;
	}
	
	
})